using UnityEngine;
using System.Collections;

public class SelfDestory : MonoBehaviour {
	private float begin;
	public float lifeTime;
	// Use this for initialization
	void Start () {
		begin = Time.time;
		
	}
	
	// Update is called once per frame
	void Update () {
		if(Time.time - begin > lifeTime)
			GameObject.Destroy(gameObject);
	} 
}
